<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../app/src/css/index.css">
</head>
<body>
    <header>我是头部</header>
    <aside>
        <nav>我是左边
            <a href="#/1">进入1</a> 
            <a href="#/2">进入2</a>
            <a href="#/3">进入3</a>
        </nav>
        <div class="count"></div>
    </aside>
</body>
</html>
<script type="module">
import router from './src/router/index.js'

const count = document.querySelector('.count')

window.onhashchange = function(){

    const hash = location.hash.slice(1)

    const template = router.routes
    .find(d => d.path === hash)
    .component.template;

    count.innerHTML = template;
}

</script>